
var content = "";

Comps.ResouceActivtyList = function(config){
    this.compId = config.compId;
    this.config = config;
}
//异步情况下渲染数据
Comps.ResouceActivtyList.prototype.init=function(){
    var ts = this;
    var needAsyncInit = ts.config.needAsyncInit;
    var contentCategoryUuid = ts.config.contentCategoryUuid;
    if(needAsyncInit){
        ts.ajaxLoadData();
    }else{
    	ts.bindEvent();
		Utils.ajaxLoadComplate(ts);

    }
}

Comps.ResouceActivtyList.prototype.ajaxLoadData = function (option) {
    var ts = this;
    var compId = this.compId
    $.ajax({
        "url": ContextPath+"/resouceActivtyList/ajaxLoadData.json",
        "data" : option,
        "success": function (data) {
        	  ts._renderProdcutList(data);
        }
    })
}


Comps.ResouceActivtyList.prototype.bindEvent = function () {
	var ts = this;

	//删除加载的  download-layout样式
	$(".download-layout").eq(0).remove();
	
	var totalPage = $("#totalPage").val();
	var categoryUuid = ts.config.contentCategoryUuid;
   var compId = ts.config.compId;
	var pageShow = ts.config.pageShow;

   var thisPage = $("#"+compId+"_page");
	/*首页按钮*/
    $("#"+compId+" .first_btn").click(function(){
        //当前页对象
        var nowPageObj = $(this).siblings('.y_cur');
        nowPageObj.removeClass("y_cur");  //当前页置灰
        thisPage.find('.page_turn').eq(0).addClass("y_cur"); //第一页码选中
        thisPage.find(".y_num").text(1); //到m页
        thisPage.find('.last_btn').addClass("disabled");//上一页置灰
        if (totalPage != 1) {
          thisPage.find('.next_btn').removeClass("disabled");//下一页亮起
         };

        var option ={"nowPage":"1","categoryUuid":categoryUuid,"showPage":pageShow};
        ts.ajaxLoadData(option);
    });
    
    /*上一页按钮*/
    $("#"+compId+" .last_btn").click(function(){
         //当前页对象
         var nowPageObj = $(this).siblings('.y_cur');
         //上一页
        var nowPage = nowPageObj.text();
        var page = parseInt(nowPage) - 1;

        if(page == 1){
            thisPage.find(".last_btn").addClass("disabled");
        }
        nowPageObj.removeClass("y_cur");  //当前页置灰
        thisPage.find('.page_turn').eq(page-1).addClass("y_cur"); //页码选中
        thisPage.find(".y_num").text(page); //到m页
        thisPage.find('.next_btn').removeClass("disabled");//下一页亮起

        //加载数据
        var option ={"nowPage":page,"categoryUuid":categoryUuid,"showPage":pageShow};
        ts.ajaxLoadData(option);
    });
	
    /*页数按钮*/
    $("#"+compId+" .page_turn").click(function(){

        //其他页置灰
        $(this).siblings().removeClass("y_cur"); 
         //当前页
         var nowPage = parseInt($(this).text());

        thisPage.find('.page_turn').eq(nowPage - 1).addClass("y_cur"); //页码选中
        thisPage.find(".y_num").text(nowPage); //到m页

        if(nowPage != 1){
         thisPage.find(".last_btn").removeClass("disabled"); //上一页亮起
        }
        if(nowPage == 1){
         thisPage.find(".last_btn").addClass("disabled"); //上一页置灰
        }
        if(nowPage != totalPage){
         thisPage.find(".next_btn").removeClass("disabled");// 下一页亮起
        }
        if(nowPage == totalPage){
         thisPage.find(".next_btn").addClass("disabled");// 下一页置灰
        }

        var option ={"nowPage":nowPage,"categoryUuid":categoryUuid,"showPage":pageShow};
        ts.ajaxLoadData(option);
        
    });
    
    
    /*下一页按钮*/
    $("#"+compId+" .next_btn").click(function(){

        //当前页对象
        var nowPageObj = $(this).siblings('.y_cur');
        //上一页
       var nowPage = nowPageObj.text();
       var page = parseInt(nowPage) + 1;

       if(page == totalPage){
           thisPage.find(".next_btn").addClass("disabled");
       }
       nowPageObj.removeClass("y_cur");  //当前页置灰
       thisPage.find('.page_turn').eq(page-1).addClass("y_cur"); //页码选中
       thisPage.find(".y_num").text(page); //到m页
       thisPage.find('.last_btn').removeClass("disabled");//上一页亮起

          //加载数据
        var option ={"nowPage":page,"categoryUuid":categoryUuid,"showPage":pageShow};
        ts.ajaxLoadData(option);
    });
    
    /*尾页按钮*/
    $("#"+compId+" .end_btn").click(function(){
         //当前页对象
        var nowPageObj = $(this).siblings('.y_cur');
        nowPageObj.removeClass("y_cur");  //当前页置灰
        thisPage.find('.page_turn').eq(totalPage-1).addClass("y_cur"); //最后页码选中
        thisPage.find(".y_num").text(totalPage); //到m页
        thisPage.find('.next_btn').addClass("disabled");//下一页置灰
        if (totalPage != 1) {
          thisPage.find('.last_btn').removeClass("disabled");//上一页亮起
        };


	    var option ={"nowPage":totalPage,"categoryUuid":categoryUuid,"showPage":pageShow};
        ts.ajaxLoadData(option);
    });
    
    $(".y_pagenumber").mouseover(function(){
        $(this).addClass("active");
    });
    $(".y_pagenumber").mouseout(function(){
        $(this).removeClass("active");
    });
    
    $("#"+compId+" ul#page_btn").on("click","li",function(){
         //当前页
         var nowPage = parseInt($(this).text());

          //其他页置灰
         thisPage.find('.page_turn').removeClass("y_cur").eq(nowPage - 1).addClass("y_cur"); //页码选中
         thisPage.find(".y_num").text(nowPage); //到m页

         if(nowPage != 1){
          thisPage.find(".last_btn").removeClass("disabled"); //上一页亮起
         }
         if(nowPage == 1){
          thisPage.find(".last_btn").addClass("disabled"); //上一页置灰
         }
         if(nowPage != totalPage){
          thisPage.find(".next_btn").removeClass("disabled");// 下一页亮起
         }
         if(nowPage == totalPage){
          thisPage.find(".next_btn").addClass("disabled");// 下一页置灰
         }
         var option ={"nowPage":nowPage,"categoryUuid":categoryUuid,"showPage":pageShow};
         ts.ajaxLoadData(option);
     });
}


//渲染活动风采列表
Comps.ResouceActivtyList.prototype._renderProdcutList = function(data){
    var compId = this.config.compId;
    var productsEle = $("#"+compId+"_main");
    var productLoopEle = $("#"+compId+"_a");
    productsEle.find(".j_a").remove();
    var productList = data;
    //循环渲染活动风采
    if(productList.length>0){

        //noResultEle.remove();
        for(var i=0;i<productList.length;++i){
            var model = productList[i];
            var newEle = productLoopEle.clone();
            //渲染产品保养Element
            this._renderProductInfo(newEle,model);
            productsEle.append(newEle);
        }
    }else{
    	productsEle.remove();
    }
    //this.bindEvent();
}
//渲染活动信息
Comps.ResouceActivtyList.prototype._renderProductInfo=function(newEle,model){

	newEle.attr("href",ContextPath + "/frontshow/content/getResourceActivity/" + model.uuid)
	  //标题
    var titleEle = newEle.find(".j_title");
    //图片
    var picEle = newEle.find(".j_pic");
    //内容
    var contentEle = newEle.find(".j_content");

    var dayTimeEle = newEle.find(".j_dayTime");

    titleEle.html(model.contentTitle);

    picEle.prop("src",model.iconPath);

    contentEle.html(model.note);

    dayTimeEle.html(model.dayTime);

}


Comps.ResourceAnswer = function(config){
    this.compId = config.compId;
    this.config = config;
}
//异步情况下渲染数据
Comps.ResourceAnswer.prototype.init=function(){
    var ts = this;
    var needAsyncInit = ts.config.needAsyncInit;
    var contentCategoryUuid = ts.config.contentCategoryUuid;
    if(needAsyncInit){
        ts.ajaxLoadData();
    }else{
		Utils.ajaxLoadComplate(ts);
    }

}

Comps.ResourceVedio = function(config){
    this.compId = config.compId;
    this.config = config;
}
//异步情况下渲染数据
Comps.ResourceVedio.prototype.init=function(){
    var ts = this;
    var needAsyncInit = ts.config.needAsyncInit;
    if(needAsyncInit){
        ts.ajaxLoadData();
    }else{

		Utils.ajaxLoadComplate(ts);
		 ts.bindEvent();
    }

}

Comps.ResourceVedio.prototype.bindEvent = function(){
    var ts = this;
	//详情页自由搭配商品切换
	if($('.campus-video-gbox.owl-carousel').length && $.fn.owlCarousel){
		$('.campus-video-gbox.owl-carousel').owlCarousel({
		   items:4,
		   itemsDesktop:false,
		   itemsDesktopSmall:false,
		   itemsTablet:false,
		   navigation: true,
		   navigationText: false,
		   pagination: false,
		   slideSpeed: 500
	  });
	};

	$(".campus-video-gbox li a").on("click",function() {
  		var imgSrc = $(this).attr("num");
  		var videoDom = document.querySelector("video");
  		videoDom.src = imgSrc;
  		videoDom.play();
  		$(".campus-video-top").css("display","none");
    });

	$(".campus-video-top").on("click",function(){
    	var videoDom = document.querySelector("video").play();
    	$(".campus-video-top").css("display","none");
    })

}



Comps.ResourceNet = function(config){
    this.compId = config.compId;
    this.config = config;
}
//异步情况下渲染数据
Comps.ResourceNet.prototype.init=function(){
    var ts = this;
    var needAsyncInit = ts.config.needAsyncInit;
    var contentCategoryUuid = ts.config.contentCategoryUuid;
    if(needAsyncInit){
        ts.ajaxLoadData();
    }else{
		Utils.ajaxLoadComplate(ts);
    }

}


/**
 * ProductMainTain
 * Created by xc on 2017/5/5.
 */
/**
 * Created by xc on 2017/5/5.
 */
Comps.ProductMaintain = function(config){
    this.compId = config.compId;
    this.config = config;
}
//异步情况下渲染数据
Comps.ProductMaintain.prototype.init=function(){
    var ts = this;
    var needAsyncInit = ts.config.needAsyncInit;
    var contentCategoryUuid = ts.config.contentCategoryUuid;
    if(needAsyncInit){
        ts.ajaxLoadData();
    }else{
        ts.bindEvent();
		Utils.ajaxLoadComplate(ts);
    }
}

//ajax请求数据
Comps.ProductMaintain.prototype.ajaxLoadData =function(queryData){
    var ts = this;
    var contentCategoryUuid = ts.config.contentCategoryUuid;
    var defaultData = {
        "contentCategoryUuid":contentCategoryUuid
    }
    $.extend(defaultData,queryData);
    $.ajax({
        "url":ContextPath+"/productMaintainComp/ajaxLoadData.json",
        data: defaultData,
        "success":function(data){
            ts._renderProdcutList(data);
            Utils.ajaxLoadComplate(ts);
        }
    })
}
//渲染产品保养列表
Comps.ProductMaintain.prototype._renderProdcutList = function(data){
    var compId = this.config.compId;
    var taxonPaths =  data.taxonPath ;
    var taxonPaths1 = taxonPaths.split(">");
    var productList = data.contentList;
    var contentCategoryList = data.list;
    $("#"+compId+"_crumbs").html("");
    var html = "<a href='/'>首页</a><span class='separate'>/</span>";
    for(var i=0;i<taxonPaths1.length;i++){
        if(i == taxonPaths1.length-2){
            html += "<span>"+taxonPaths1[i]+"</span>";
            break;
        }else{
            html += "<a href='javascript:viod();'>"+taxonPaths1[i]+"</a><span class='separate'>/</span>";
        }
    }
    $("#"+compId+"_crumbs").html(html);
    $("#"+compId+"_title").html(taxonPaths1[taxonPaths1.length-2]);
    $("#"+compId+"_tab").html("");
    if(contentCategoryList.length > 0){
        var html1 = "";
        for(var i=0; i<contentCategoryList.length; i++){
            if(i==0){
                html1 += "<div class='m_itme active' id='"+contentCategoryList[i].uuid+"'><s><img id='$_compId_img' src='"+contentCategoryList[i].iconPath+"'></s>"+contentCategoryList[i].categoryName+"</div >";
            }else{
                html1 += "<div class='m_itme' id='"+contentCategoryList[i].uuid+"'><s><img id='$_compId_img' src='" + contentCategoryList[i].iconPath + "'></s>" + contentCategoryList[i].categoryName + "</div >";
            }
        }
        $("#"+compId+"_tab").html(html1);
    }
    $("#j_content").html("");
    if(productList.length>0){
        var html2 = "";
        for(var i=0;i<productList.length;++i){
            html2 += "<div class='m_maintain'><h5>"+productList[i].contentTitle+"</h5>";
            html2 += "<div class='m-problemdrop' style='display: block;'><div class='m-pic'>";
            html2 += "<img src='"+productList[i].iconPath+"'></div>";
            html2 += "<div class='tit'>"+productList[i].introduction+"</div></div></div>";
        }
    }else{//若无产品保养，提示无产品保养
        html2 += "无产品保养";
    }
   $("#j_content").html(html2);
    this.bindEvent();
}
Comps.ProductMaintain.prototype.bindEvent = function(){
    var ts = this;
    var compId = ts.config.compId;
    $(".m_itme").click(function (){
    	$(".active").removeClass("active");
		$(this).addClass("active");
		var contentCategoryUuid = $(this).attr("id");
		$.ajax({
            "url":ContextPath+"/productMaintainComp/loadData.json",
            data: {"contentCategoryUuid":contentCategoryUuid},
            "success":function(data){
                ts.loadData(data);
            }
        })
	});
}
Comps.ProductMaintain.prototype.loadData = function(data){
    var productList = data.contentList;
    $("#j_content").html("");
    var html2 = "";
    if(productList.length>0){
        for(var i=0;i<productList.length;++i){
            html2 += "<div class='m_maintain'><h5>"+productList[i].contentTitle+"</h5>";
            html2 += "<div class='m-problemdrop' style='display: block;'><div class='m-pic'>";
            html2 += "<img src='"+productList[i].iconPath+"'></div>";
            html2 += "<div class='tit'>"+productList[i].introduction+"</div></div></div>";
        }
    }else{//若无产品保养，提示无产品保养
         html2 += "无产品保养";
    }
    $("#j_content").html(html2);
    this.bindEvent();
}


//########### 校园招聘宣讲行程##########9


Comps.ResourceCourses = function(config){
    this.compId = config.compId;
    this.config = config;
}
//异步情况下渲染数据
Comps.ResourceCourses.prototype.init=function(){
    var ts = this;
    var needAsyncInit = ts.config.needAsyncInit;
    if(needAsyncInit){
        ts.ajaxLoadData();
    }else{
		Utils.ajaxLoadComplate(ts);
    }

}

//异步获取
Comps.ResourceCourses.prototype._renderProdcutList = function(data){
    var compId = this.config.compId;
    var productsEle = $("#"+compId+"_main");
    var productLoopEle = $("#"+compId+"_list");

    var productEle = $("#"+compId + "_var");
    productsEle.find(".j_pdtain_var").remove();

    var productList = data;
    //循环渲染产品保养信息
    if(productList.length>0){

        //noResultEle.remove();
        for(var i=0;i<productList.length;++i){
            var model = productList[i];
            var newEle = productEle.clone();
            //渲染产品保养Element
            this._renderProductInfo(newEle,model);
            productLoopEle.append(newEle);
        }
    }else{//若无产品保养，提示无产品保养
        productEle.remove();
    }
     this.bindEvent();
}

//########### 校园招聘宣讲行程end##########9

//########### 校园招聘宣岗位需求##########9


Comps.ResourcePosition = function(config){
    this.compId = config.compId;
    this.config = config;
}
//异步情况下渲染数据
Comps.ResourcePosition.prototype.init=function(){
    var ts = this;
    var needAsyncInit = ts.config.needAsyncInit;
    if(needAsyncInit){
        ts.ajaxLoadData();
    }else{

		Utils.ajaxLoadComplate(ts);
    }

}

//异步获取
Comps.ResourcePosition.prototype._renderProdcutList = function(data){
    var compId = this.config.compId;
    var productsEle = $("#"+compId+"_main");
    var productLoopEle = $("#"+compId+"_list");

    var productEle = $("#"+compId + "_var");
    productsEle.find(".j_pdtain_var").remove();
    var productList = data;
    if(productList.length>0){
        for(var i=0;i<productList.length;++i){
            var model = productList[i];
            var newEle = productEle.clone();
            this._renderProductInfo(newEle,model);
            productLoopEle.append(newEle);
        }
    }else{
        productEle.remove();
    }
     this.bindEvent();
}

//########### 校园招聘宣岗位需求end##########9



//########### 解决方案组件##########9
/**
 * SolveScheme   解决方案组件
 * Created by xc on 2017/5/5.
 */
Comps.SolveScheme = function(option){
	  this.compId = option.compId;
	  this.needAsyncInit = option.needAsyncInit;
	  this.imgSrc = option.imgSrc;
	  this.url = option.url;
	  this.title = option.title;
	  this.content = option.content;
	  this.solveUuid = option.solveUuid;
	}


//异步情况下渲染数据
Comps.SolveScheme.prototype.init=function(){
	  var that =this;
		if (this.needAsyncInit) {
		$("#"+that.compId+"_img").attr("src",that.imgSrc);
		$("#"+that.compId+"_title").html(that.title);
	    $("#"+that.compId+"_note").html(that.content);
		}

	  that.bindEvent();
	  Utils.ajaxLoadComplate(that);


}

//解决方案组件初始化事件
Comps.SolveScheme.prototype.bindEvent = function(){
    var that = this;
    $("#"+that.compId+"_a").click(function(){
		window.open(ContextPath + that.url);
	})

	//详情页自由搭配商品切换
	if($('.solve-other-box.owl-carousel').length && $.fn.owlCarousel){
		$('.solve-other-box.owl-carousel').owlCarousel({
		   items:7,
		   itemsDesktop:false,
		   itemsDesktopSmall:false,
		   itemsTablet:false,
		   navigation: true,
		   navigationText: false,
		   pagination: false,
		   slideSpeed: 500
	  });
	};
}
//########### 解决方案组件##########9



//###########案例组件##########9
/**
 * SolveCase  案例组件
 * Created by xc on 2017/5/5.
 */
Comps.SolveCase = function(option){
  this.compId = option.compId;
  this.needAsyncInit = option.needAsyncInit;
  this.imgSrc = option.imgSrc;
  this.url = option.url;
  this.title = option.title;
  this.content = option.content;
  this.solveUuid = option.solveUuid;
}


//异步情况下渲染数据
Comps.SolveCase.prototype.init=function(){

  var that =this;
	if (this.needAsyncInit) {
	$("#"+that.compId+"_img").attr("src",that.imgSrc);
    $("#"+that.compId+"_note").html(that.title);
	}

  that.bindEvent();
  Utils.ajaxLoadComplate(that);

}



//解决方案组件初始化事件
Comps.SolveCase.prototype.bindEvent = function(){
    var that = this;
	$("#"+that.compId+"_a").click(function(){
		window.open(ContextPath + that.url);
	})
}
//###########案例组件##########9



//###########人力资源首页广告图##########9



Comps.ResourseAd = function(option) {
	this.compId = option.compId;
	this.needAsyncInit = option.needAsyncInit;
	this.imgSrc = option.imgSrc;
	this.defineUrl = option.defineUrl;
	this.defineWidth = option.defineWidth;
	this.defineHeight = option.defineHeight;
  this.title = option.title;
}

Comps.ResourseAd.prototype.GetQueryString = function(name) {

	var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;

}


Comps.ResourseAd.prototype.init = function() {

	var that =this;
	if (this.needAsyncInit) {
		$("#"+that.compId+"_img").attr("src",that.imgSrc);
		$("#"+that.compId+"_img").attr("width",that.defineWidth);
		$("#"+that.compId+"_img").attr("height",that.defineHeight);
       $("#"+that.compId+"_title").html(that.title);
       $("#"+that.compId+"_a").attr("href",that.defineUrl);
 }
    Utils.ajaxLoadComplate(that);
}



//###########人力资源首页广告图##########




//###########人力资源首页图##########9





//###########人力资源首页图##########


//###########社会招聘入口组件##########9
Comps.Resources = function (config) {
    this.compId = config.compId;
    this.config = config;
};
Comps.Resources.prototype.init = function () {
    var that = this;
    Utils.ajaxLoadComplate(that);

};


//###########社会招聘入口组件##########9

Comps.ResourseHead = function (config) {
    this.compId = config.compId;
    this.needAsyncInit = config.needAsyncInit;
    this.customUrl = config.customUrl;
    this.channels = config.channels;
};
Comps.ResourseHead.prototype.init = function () {
    var that = this ;
   if (that.needAsyncInit) {
        $.ajax({
            "url":ContextPath+"/resourseHeadComp/ajaxLoadData.json",
            data: {"channels" : that.channels},
            "success":function(data){
                that.bind(data);
            }
        })
   }
   Utils.ajaxLoadComplate(that);
};

Comps.ResourseHead.prototype.bind = function(data){
    var ts = this;
    var compId = ts.compId;
    if(data != null && data.length > 0){
        $("#humanResourceNavigation").html("");
        var html = "" ;
        for(var i=0; i<data.length; i++){
            html += "<div class='col-row-2' style='width: 99px;'><div class='world-header-item'>";
            var channelUrl = "" ;
            if(data[i].channelUrl == ""){
                if(data[i].anotherName != ""){
                    channelUrl = ContextPath + ts.customUrl + data[i].anotherName+".htm";
                }else{
                    channelUrl = ContextPath + ts.customUrl + data[i].pageUuid;
                }
            } else {
                channelUrl = ContextPath + data[i].channelUrl;
            }
            html += "<a href='"+channelUrl+"'>";
            html += "<p id='$_compId_title'>"+data[i].channelName+"</p>";
            html += "<img src='"+data[i].imgUrl+"' id='"+data[i].uuid+"' alt=''></a></div></div>";
        }
         $("#humanResourceNavigation").html(html);
    }
};



//###########人力资源首页底部组件##########9



Comps.ResourseBottom = function(option) {
	this.compId = option.compId;
	this.needAsyncInit = option.needAsyncInit;
	this.imgSrc = option.imgSrc;
	this.defineUrl = option.defineUrl;
    this.title = option.title;
    this.note = option.note;
    this.thirdImg = option.thirdImg;
    this.fourthImg = option.fourthImg;
    this.weiXinShow = option.weiXinShow;

}

Comps.ResourseBottom.prototype.GetQueryString = function(name) {
	var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}


Comps.ResourseBottom.prototype.init = function() {
	var that =this;
	if (that.needAsyncInit) {
        $("#"+that.compId+"_title").html(that.title);
        $("#"+that.compId+"_note").html(that.note);
        if(that.weiXinShow){
             $("#"+that.compId+"_img").attr("src",that.thirdImg);
             var html = "<div class='world-f-w-box'>" ;
             html += "<img class='world-f-box-img1' src='"+that.thirdImg+"' alt='' />" ;
             html += "<img class='world-f-box-img2' src='"+that.fourthImg+"' alt='' />" ;
             html += "<span class='world-f-box-taxt'>微信公众号</span>";
            $("#"+that.compId+"_addClass").addClass("world-f-weixin").append(html);
        }else{
            $("#"+that.compId+"_img").attr("src",that.imgSrc);
        }
	}
	that.bindSomeEvent();
    Utils.ajaxLoadComplate(that);

}


Comps.ResourseBottom.prototype.bindSomeEvent=function(){
	var that=this;
	$("#"+that.compId+"_a").click(function(){
		window.open(ContextPath+that.defineUrl);
	})
}



//###########人力资源首页底部组件##########




//###########美心之家组件##########9
Comps.ResourceHome = function (config) {
    this.compId = config.compId;
    this.config = config;
};
Comps.ResourceHome.prototype.init = function () {
    var that = this;
    that.bindSomeEvent();
    Utils.ajaxLoadComplate(that);

};

Comps.ResourceHome.prototype.bindSomeEvent=function(){
	var that=this;

	$("#"+that.compId+"_a").click(function(){
		window.open(ContextPath+that.config.url);


	})

	$(".home-jomoo").mouseover(function(){
		$(this).children('.home-jomoo-slck').children('i').css("opacity","0");
		$(this).children('.home-jomoo-slck').children('p').addClass('home-jomoo-blue');
	})
	$(".home-jomoo").mouseout(function(){
		$(this).children('.home-jomoo-slck').children('i').css("opacity","1");
		$(this).children('.home-jomoo-slck').children('p').removeClass('home-jomoo-blue');
	})
}
//###########美心之家组件end##########9


//###########美心之家员工风采组件##########9
Comps.ResourceEmplee = function (config) {
    this.compId = config.compId;
    this.config = config;
};
Comps.ResourceEmplee.prototype.init = function () {
    var that = this;
    Utils.ajaxLoadComplate(that);
    that.bindSomeEvent();
};

Comps.ResourceEmplee.prototype.bindSomeEvent=function(){
	var that=this;
	//banner切换
    $('.home-style.flexslider').flexslider({
        animation:"slide", //让滑块成为旋转木马切换必须设置animation属性为"slide",同时设置元素宽度itemWidth
        itemWidth:340, //让滑块成为旋转木马切换必须设置animation属性为"slide",同时设置元素宽度itemWidth
        itemMargin:15  //该参数设置后，还需要在css中设置旋转木马元素margin-right值为该参数的值
    });

}
//###########美心之家员工风采组件##########9



//########### 美心之家内刊组件 ##########9
/**
 * ResourceMagazine   美心之家内刊组件
 * Created by xc on 2017/6/6
 */
Comps.ResourceMagazine = function(option){
	  this.compId = option.compId;
	  this.needAsyncInit = option.needAsyncInit;
	  this.imgSrc = option.imgSrc;
	  this.url = option.url;
	  this.title = option.title;
	  this.content = option.content;
	  this.magazineUuid = option.magazineUuid;
	}


//异步情况下渲染数据
Comps.ResourceMagazine.prototype.init=function(){
	  var that =this;
	  if (this.needAsyncInit) {
		$("#"+that.compId+"_img").attr("src",that.imgSrc);
		$("#"+that.compId+"_a").attr("href",that.url);
	    $("#"+that.compId+"_note").html(that.content);
	    $("#"+that.compId+"_title").html(that.title);
        }

	  that.bindEvent();
	  Utils.ajaxLoadComplate(that);
}

//解决方案组件初始化事件
Comps.ResourceMagazine.prototype.bindEvent = function(){
    var that = this;
	$('.home-life.flexslider').flexslider({
		selector:".slides > .m-components-wrap",
	    animation:"slide", //让滑块成为旋转木马切换必须设置animation属性为"slide",同时设置元素宽度itemWidth
	    itemWidth:210, //让滑块成为旋转木马切换必须设置animation属性为"slide",同时设置元素宽度itemWidth
	    itemMargin:70  //该参数设置后，还需要在css中设置旋转木马元素margin-right值为该参数的值
	  });
}


//########### 美心之家内刊组件end ##########9

//########### 人力资源-薪资福利右侧组件 ##########9
/**
 * ResourceMagazine   美心之家内刊组件
 * Created by xc on 2017/6/6
 */
Comps.ResourceRight = function(option){
	  this.compId = option.compId;
	  this.needAsyncInit = option.needAsyncInit;
	  this.imgSrc = option.imgSrc;
	  this.url = option.url;
	  this.title = option.title;
	  this.content = option.content;
	  this.magazineUuid = option.magazineUuid;
	}


//异步情况下渲染数据
Comps.ResourceRight.prototype.init=function(){

	  var that =this;
	  if (this.needAsyncInit) {
		$("#"+that.compId+"_img").attr("src",that.imgSrc);
		$("#"+that.compId+"_a").attr("href",that.url);
	    $("#"+that.compId+"_note").html(that.content);
	    $("#"+that.compId+"_title").html(that.title);
		}

	  that.bindEvent();
	  Utils.ajaxLoadComplate(that);


}

//解决方案组件初始化事件
Comps.ResourceRight.prototype.bindEvent = function(){
    var that = this;

}


//########### 人力资源-薪资福利右侧组件 end ##########9



//########### 人力资源-薪资福利左侧组件 ##########9
/**
 * ResourceMagazine  人力资源-薪资福利左侧组件
 * Created by xc on 2017/6/6
 */
Comps.ResourceLeft = function(option){
	  this.compId = option.compId;
	  this.needAsyncInit = option.needAsyncInit;
	  this.title = option.title;
	  this.imgSrc = option.imgSrc;
	  this.defineWidth = option.defineWidth;
	  this.defineHeight = option.defineHeight;
	}


//异步情况下渲染数据
Comps.ResourceLeft.prototype.init=function(){
	  var that =this;
	  that.bindEvent();
	  Utils.ajaxLoadComplate(that);
}


//解决方案组件初始化事件
Comps.ResourceLeft.prototype.bindEvent = function(){
		$(".pay-list-l div a:first").addClass('mouseover-l01');
    var that = this;
    $(".pay-list-l div a").mouseover(function(){

		var listLi = $(this).parent("div").index();
		if( listLi == 0 ){
			$(this).addClass('mouseover-l01').parent().parent().parent().parent().siblings('div').children('div').children('div').children('div').children('a').removeClass('mouseover-l01');
		}
		if( listLi == 1 ){
			$(this).addClass('mouseover-l01').parent().parent().parent().parent().siblings('div').children('div').children('div').children('div').children('a').removeClass('mouseover-l01');
		}
		if( listLi == 2 ){
			$(this).addClass('mouseover-l01').parent().parent().parent().parent().siblings('div').children('div').children('div').children('div').children('a').removeClass('mouseover-l01');
		}
		$(".campus-list-r").hide().eq($(".pay-list-l div a").index(this)).show();
	})
	$(".campus-list-r").hide().eq($(".pay-list-l div a").index(0)).show();
}


//########### 人力资源-薪资福利左侧组件 end ##########9


//########### 人力资源-美心商学院简介组件 ##########9
/**
 * ResourceMagazine  人力资源-美心商学院简介组件
 * Created by xc on 2017/6/12
 */
Comps.ResourceIntroduction = function(option){
	  this.compId = option.compId;
	  this.needAsyncInit = option.needAsyncInit;
	  this.imgSrc = option.imgSrc;
	  this.url = option.url;
	  this.title = option.title;
	  this.content = option.content;

	}


//异步情况下渲染数据
Comps.ResourceIntroduction.prototype.init=function(){
	  var that =this;
	  that.bindEvent();
	  Utils.ajaxLoadComplate(that);
}


//解决方案组件初始化事件
Comps.ResourceIntroduction.prototype.bindEvent = function(){
    var that = this;

}


//########### 人力资源-美心商学院简介组件 end ##########9



//########### 人力资源-美心商学院简介组件 ##########9
/**
* ResourceMagazine  人力资源-美心商学院讲师组件
* Created by xc on 2017/6/12
*/
Comps.ResourceTeacher = function(option){
	  this.compId = option.compId;
	  this.needAsyncInit = option.needAsyncInit;
	  this.imgSrc = option.imgSrc;
	  this.url = option.url;
	  this.title = option.title;
	  this.content = option.content;
	  this.description = option.description;
	}


//异步情况下渲染数据
Comps.ResourceTeacher.prototype.init=function(){
	  var that =this;
	  that.bindEvent();
	  Utils.ajaxLoadComplate(that);
}


//解决方案组件初始化事件
Comps.ResourceTeacher.prototype.bindEvent = function(){
  var that = this;

}


//########### 人力资源-美心商学院简介组件 end ##########9


//########### 人力资源-美心商学院简介组件 ##########9
/**
* ResourceMagazine  人力资源-美心商学院讲师组件
* Created by xc on 2017/6/12
*/
Comps.ResourceTeach = function(option){
	  this.compId = option.compId;
	  this.needAsyncInit = option.needAsyncInit;
	  this.imgSrc = option.imgSrc;
	  this.url = option.url;
	  this.title = option.title;
	  this.content = option.content;
	  this.description = option.description;
	}


//异步情况下渲染数据
Comps.ResourceTeach.prototype.init=function(){
	  var that =this;
	  that.bindEvent();
	  Utils.ajaxLoadComplate(that);
}


//解决方案组件初始化事件
Comps.ResourceTeach.prototype.bindEvent = function(){
  var that = this;
		//详情页自由搭配商品切换
		if($('.trade-style-js.owl-carousel').length && $.fn.owlCarousel){
			$('.trade-style-js.owl-carousel').owlCarousel({
			   items:1,
			   itemsDesktop:false,
			   itemsDesktopSmall:false,
			   itemsTablet:false,
			   navigation: true,
			   navigationText: false,
			   pagination: false,
			   slideSpeed: 500
		  });
		};
}


//########### 人力资源-美心商学院简介组件 end ##########9



Comps.ResouceActivtyList1 = function(config){
    this.compId = config.compId;
    this.config = config;
}
//异步情况下渲染数据
Comps.ResouceActivtyList1.prototype.init=function(){
	var queryData;
    var ts = this;
    var needAsyncInit = ts.config.needAsyncInit;
    var contentCategoryUuid = ts.config.contentCategoryUuid;
    if(needAsyncInit){
        ts.ajaxLoadData(queryData,ts.config.pageShow);
    }else{
        ts.bindEvent();
		    Utils.ajaxLoadComplate(ts);
    }

}


//ajax请求数据
Comps.ResouceActivtyList1.prototype.ajaxLoadData =function(queryData,nowPage,showPage){
    var ts = this;
    var contentCategoryUuid = ts.config.contentCategoryUuid;
    var defaultData = {
        "contentCategoryUuid":contentCategoryUuid,"nowPage":nowPage,"showPage":showPage
    }
    $.extend(defaultData,queryData);
    $.ajax({
        "url":ContextPath+"/resouceActivtyList/ajaxLoadData.json",
        data: defaultData,
        "success":function(data){
            ts._renderProdcutList(data);
            Utils.ajaxLoadComplate(ts);
        }
    })
}
//渲染产品保养列表
Comps.ResouceActivtyList1.prototype._renderProdcutList = function(data){
    var compId = this.config.compId;
    var productsEle = $("#"+compId+"_main");
    var productLoopEle = $("#"+compId+"_list");
    productsEle.find(".j_pdtain_list").remove();
    var productList = data;
    //循环渲染产品保养信息
    if(productList.length>0){

        //noResultEle.remove();
        for(var i=0;i<productList.length;++i){
            var model = productList[i];
            var newEle = productLoopEle.clone();
            //渲染产品保养Element
            this._renderProductInfo(newEle,model);
            productsEle.append(newEle);
        }
    }else{//若无产品保养，提示无产品保养
        productEle.remove();
    }
    this.bindEvent();
}
//渲染产品保养信息
Comps.ResouceActivtyList1.prototype._renderProductInfo=function(newEle,model){
	  //标题
    var titleEle = newEle.find(".j_title");
    //图片
    var picEle = newEle.find(".j_pic");
    //内容
    var contentEle = newEle.find(".j_content");

    var dayTimeEle = newEle.find(".j_dayTime");

    titleEle.html(model.contentTitle);

    picEle.prop("src",model.iconPath);

    contentEle.html(model.introduction);

    dayTimeEle.html(model.dayTime);


}

Comps.ResouceActivtyList1.prototype.bindEvent = function(){
    var ts = this;
    var compId = ts.config.compId;

}



/***************    ******************/

Comps.ResourceMessage = function(option){
	this.compId = option.compId;
    this.config = option;
	}


//异步情况下渲染数据
Comps.ResourceMessage.prototype.init=function(){
	  var that =this;

	  that.bindEvent();
	  Utils.ajaxLoadComplate(that);


}

Comps.ResourceMessage.prototype.bindEvent = function(){
  var that = this;

}


